package com.stillalive.springaop.proxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class JDKInvocation implements InvocationHandler {
    private Object target;
    public JDKInvocation(Object target) {
        this.target = target;
    }
    // 调用目标方法需要执行的逻辑
    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("start proxy");
        Object invoke = method.invoke(target, args);
        System.out.println("end proxy");
        return invoke;
    }
}
